package controllers.caterinaController.controllers;

import java.sql.SQLException;
import java.util.ArrayList;

import budget.Budget;
import budget.Service;
import controllers.dbWrapper.ServiceWrapper;

public class ServiceManager {
	
	
	public static void insertService(Service service) throws Exception{
		LoginManager.getCurrentLogged();
		ServiceWrapper.insertService(true, service);
	}
	
	public static ArrayList<Service> getAllServices() throws Exception{
		return ServiceWrapper.getAllServices(true);
	}
	
	public static ArrayList<Service> getServices(Budget budget) throws Exception{
		ArrayList<Service> servs = ServiceWrapper.getBudgetServices(budget.getId(), true);
		return servs;
	}
	
	public static void updateService(Service service) throws SQLException, Exception{
		ServiceWrapper.modifyService(service, true);
	}
	
	public static void removeService(Service serv) throws SQLException, Exception{
		ServiceWrapper.removeService(serv, true);
	}

}
